package com.barneyx.mshinfoplatform.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import lombok.Getter;

@ApiModel("性别")
@Getter
public enum ESex implements IEnum<String>{
    MEN(1,"MEN"),
    LADY(2,"LADY"),
    OTHER(3,"OTHER");
    ESex(int code,String value){
        this.code = code;
        this.value = value;
    }

    public static ESex SearchIntByCode(int code){
        for (ESex e:ESex.values()){
            if(e.code==code){
                return e;
            }
        }
        return null;
    }

    @EnumValue
    private final int code;
    @JsonValue
    private final String value;
}
